<!DOCTYPE html>
<html>
<head>
    <th:block th:include="include :: headermain('互助保障系统')"/>
</head>
<body>

<div class="page">

    <th:block th:include="include :: top"/>


    <div class="center">
        <div class="page-content page-wrap">
            <th:block th:include="include :: left"/>
            <div class="page-wrap-container">

                <div class="page-account-message">
                    <div class="page-tab">
                        <a href="/message/hzUnitMessage/unreadMessage">未读消息</a>
                        <a class="on" href="/message/hzUnitMessage/readedMessage">已读消息</a>
                    </div>
                    <div class="page-tab-content" style="display:block;">
                        <table class="page-table page-table-list">
                            <tr>
                                <th>消息标题</th>
                                <th style="width:180px;">接收时间</th>
                            </tr>
                            <c:forEach items="${page.list}" var="message">
                                <tr>
                                    <td>
                                        <a href="/message/hzUnitMessage/messageDetail?id=${message.id}">${message.title}</a>
                                    </td>
                                    <td>
                                        <fmt:formatDate value="${message.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
                                    </td>
                                </tr>
                            </c:forEach>
                        </table>
                        <div class="page-pagination">

                            <!--    当前页之前 -->
                            <span>共${page.count}条记录 ${page.pageNo}/${page.last}</span>
                            <c:choose>
                                <c:when test="${page.pageNo == 1}">
                                    <span>首页</span>
                                    <span>上一页</span>
                                </c:when>
                                <c:otherwise>
                                    <a href='/message/hzUnitMessage/readedMessage&pageNo=1&pageSize=10'> 首页</a>
                                    <a href='/message/hzUnitMessage/readedMessage&pageNo=${page.pageNo-1}&pageSize=10'>上一页</a>
                                    <c:choose>
                                        <c:when test="${(page.pageNo - 5) > 0}">
                                            <c:forEach step="1" begin="${page.pageNo-5}" end="${page.pageNo-1}"
                                                       varStatus="status">
                                                <a href='/message/hzUnitMessage/readedMessage&pageNo=${begin+status.index}&pageSize=10'>${begin+status.index}</a>
                                            </c:forEach>
                                        </c:when>
                                        <c:otherwise>
                                            <c:forEach step="1" begin="1" end="${page.pageNo-1}" varStatus="status">
                                                <a href='/message/hzUnitMessage/readedMessage&pageNo=${begin+status.index}&pageSize=10'>${begin+status.index}</a>
                                            </c:forEach>
                                        </c:otherwise>
                                    </c:choose>

                                </c:otherwise>
                            </c:choose>
                            <!--      当前页 -->
                            <span>${page.pageNo}</span>
                            <!--  当前页之后 -->
                            <c:choose>
                                <c:when test="${page.pageNo == page.last}">
                                    <span>下一页</span>
                                    <span>尾页</span>
                                </c:when>
                                <c:otherwise>
                                    <a href='/message/hzUnitMessage/readedMessage&pageNo=${page.pageNo + 1}&pageSize=10'>${page.pageNo
                                        + 1}</a>
                                    <a href='/message/hzUnitMessage/readedMessage&pageNo=${page.pageNo + 1}&pageSize=10'>
                                        下一页</a>
                                    <a href='/message/hzUnitMessage/readedMessage&pageNo=${page.last}&pageSize=10'>尾页</a>
                                </c:otherwise>
                            </c:choose>

                        </div>
                    </div>
                </div>


            </div>
        </div>
    </div>


    <th:block th:include="include :: footer"/>

</div>


<script src="/footerjs.js"></script>

<script type="text/javascript">


</script>


</body>
</html>
